package com.freework.sys.table.dao;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;

import org.springframework.stereotype.Component;

import com.freework.sys.cache.DICCollectionOrderCode;
import com.freework.sys.table.vo.SysDictableVO;
public class CacheMethod {
	
	static List list=new ArrayList(80000);
	
	
	
	
	@Cacheable(value="dic_table_info_cache1",key="'dictable'")
	public DICCollectionOrderCode getAll() {
		for (int i = 0; i < 10; i++) {
			list.add(new SysDictableVO(i,"table"+i,"sdfasdfsdaf"));
		}
		
		System.out.println("=====getAll=======");
		return new DICCollectionImp(list,"tableid","tablename");
	}
	@CachePut(value="dic_table_info_cache",key="'dictable'")
	public DICCollectionOrderCode set(int id,SysDictableVO vo) {
		DICCollectionImp dic=(DICCollectionImp)this.getAll();
		System.out.println("================");
		dic.updateTable(id, vo);
		list.set(id, vo);
		return dic;
	}	
	
	
	
	
	
}


